<template>
  <div>
    <div>
      <strong>拖拽组件</strong>
    </div>
    <List border>
      <ListItem v-for="(item,i) in partsList" :key="i">
        <div style="width:100%;" @dragstart="ondragstart(item)" draggable="true">
          <Render :option="item" />
        </div>
      </ListItem>
    </List>
  </div>
</template>

<script>
import Render from "@/components/Render";
import iViewConfig from '@/viewsConfig/iView/index'
import commonConfig from '@/viewsConfig/common/index'

export default {
  name: "Parts",
  components: { Render: Render },
  data() {
    return {
      partsList: {
        ...commonConfig,
        ...iViewConfig,
      }
    };
  },
  methods: {
    ondragstart(item) {
      event.dataTransfer.setData("dragInfo", JSON.stringify(item));
    }
  }
};
</script>

<style>
</style>